<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::resource('/', "Home\IndexController");


//后台路由组
Route::group(['prefix' => 'admin','middleware'=>'admin'], function () {
    Route::get('/', "Admin\IndexController@index");//后台首页
	
	Route::resource('user',"Admin\UserController"); //后台会员管理
	Route::get('user/dong/{id}',"Admin\UserController@dong"); //后台冻结用户
	Route::get('user/jdong/{id}',"Admin\UserController@jdong"); //后台解冻用户
	
	Route::resource('users', 'Admin\AdminuserController');//后台会员管理
    Route::resource('role', 'Admin\RoleController');
    Route::resource('node', 'Admin\NodeController');
	
	
    Route::get('users/loadRole/{uid}',"Admin\AdminuserController@loadRole");
    Route::post('users/saveRole',"Admin\AdminuserController@saveRole");
    
    Route::get('role/loadNode/{rid}',"Admin\RoleController@loadNode");
    Route::post('role/saveNode',"Admin\RoleController@saveNode");
	
	Route::resource('address',"Admin\AddressController");  //后台用户地址管理
	
	Route::resource('order',"Admin\OrderController");  //后台用户订单管理

	Route::resource('goodsDetail',"Admin\goodsDetailController");//后台商品详情管理
	

	Route::resource('comment',"Admin\CommentController");//后台的评论管理

	Route::resource('type', 'Admin\TypeController'); //后台商品类别管理
	

	Route::resource('ask',"Admin\AskController");//后台问管理

	Route::resource('answer',"Admin\AnswerController");//后台答管理

	Route::resource('lunbo', 'Admin\LunboController'); //后台轮播图类别管理
	
	Route::resource('friendlink', 'Admin\FriendlinkController'); //后台友情链接管理
	
	Route::resource('newbook', 'Admin\NewbookController'); //后台新书上架管理
	
	Route::resource('xuanxiangka', 'Admin\XuanxiangkaController'); //后台首页的选项卡管理

	Route::resource('news', 'Admin\NewsController'); //后台新闻公告管理
	
	Route::resource('rank', 'Admin\RankController'); //后台新书排行旁管理
	
	Route::resource('list', 'Admin\ListController'); //后台列表管理
	
	Route::get('docu','Admin\ListController@doCu');
	
	Route::get('doyu','Admin\ListController@doYu');
	
	Route::resource('tuiguang', 'Admin\TuiguangController'); //后台商品推广管理
	
	Route::resource('ctype', 'Admin\CtypeController'); //后台次主页类别管理
	
	Route::resource('config', 'Admin\ConfigController'); //后台网站配置管理
	
	Route::resource('aconfig', 'Admin\AConfigController'); //后台网站配置管理
	
	//标签管理
	Route::resource('label','Admin\LabelController');
	
	Route::post('doup','Admin\goodsDetailController@doUp');//详情上传图片
	Route::get('xx','Admin\goodsDetailController@xx');

});

Route::get('/admin/login',"Admin\LoginController@login"); //加载后台登录界面

Route::post('/admin/dologin',"Admin\LoginController@doLogin"); //执行后台登录

Route::get('/admin/logout',"Admin\LoginController@logout"); //执行后台退出

Route::get('admin/getcode',"Admin\LoginController@getCode"); //加载验证码



//前台路由

//加载前台注册页面
Route::get('/home/register',"Home\RegisterController@regist");

//执行前台注册
Route::post('/home/doregist',"Home\RegisterController@doregist");

//检测新注册用户名是否已存在
Route::post('/home/checkname',"Home\ChecknameController@check");

//检测验证码是否正确
Route::post('/home/cregistercode',"Home\CrcodeController@cregistercode");


Route::get('/admin/frindlink', function () {
    return redirect('admin/friendlink');
});


//加载前台登录页面
Route::get('/home/login',"Home\LoginController@login");

//检验是否可以进行前台登录
Route::post('home/dologin',"Home\LoginController@doLogin");




//执行前台登录
Route::post('home/dologiner',"Home\LoginController@doLoginer");
//执行前台退出
Route::get("home/quit","Home\LoginController@quit");


//前台详情页
Route::resource('/home/detail',"Home\DetailController");

//前台路由组
Route::group(['prefix' => 'home','middleware'=>'home'], function () {
	
});

//个人中心
Route::resource('/home/personal',"Home\PersonalController"); //前台个人中心管理
Route::resource('/home/myorder',"Home\MyorderController"); //前台我的订单管理
Route::get('/home/address/index', 'Home\AddressController@index'); //进入个人中心地址管理
Route::get('/home/address/defaultaddr/{id}', 'Home\AddressController@defaultaddr'); //设置默认地址
Route::resource('/home/address', 'Home\MyaddressController'); //修改地址
Route::post('/home/myaddress', 'Home\MyaddressController@store'); //个人中心中添加新地址
Route::resource('/home/myinfo', 'Home\MyinfoController'); //个人信息


//购物车
Route::get('/home/shop',"Home\ShopController@index"); //进入购物车详情展示页
Route::get('home/shop/add/{id}',"Home\ShopController@add"); //成功放入购物车
Route::get('home/shop/add1/{id}',"Home\ShopController@add1"); //列表页成功放入购物车
Route::get('/home/shop/del/{id}',"Home\ShopController@destroy");  //删除购物信息
Route::get('/home/shop/jiesuan',"Home\ShopController@jiesuan");  //订单结算
Route::get('/home/shop/shuliang/{id}',"Home\ShopController@shuliang");  //修改购物车展示页商品数量

Route::get('/home/shop/fanghui/{id}',"Home\ShopController@fanghui"); //结算页放回购物车
Route::post('/home/address2', 'Home\AddressController@store'); //结算中添加新地址
Route::get('/home/address/del/{id}', 'Home\AddressController@del'); //结算中删除地址
Route::get('/home/shop/xuanze/{id}', 'Home\ShopController@xuanze'); //购物展示页的是否选中
Route::get('/home/shop/quanbu', 'Home\ShopController@quanbu'); //购物展示页的是否全选


						 
//城市级联操作
//Route::get('home/district',function(){ return view('home.shop.jiesuan'); });
Route::get('/home/district/{upid}',"Home\DistrictController@find"); //加载城市级联信息




//执行商品详情的前台分页的路由
Route::get('home/fenye',"Home\DetailController@fenye");
//前台商品详情提问的路由
Route::post('home/ask',"Home\DetailController@question");
//前台商品详情回答问题的路由
Route::post('home/answer',"Home\DetailController@reply");
//前台我的收藏的路由

Route::get('home/mysc',"Home\DetailController@mysc");//收藏主页
Route::post('home/myscadd',"Home\DetailController@addmysc");//添加收藏
Route::get('home/addtags',"Home\DetailController@checktag");//给收藏添加标签
Route::get('home/fortags',"Home\DetailController@mysc");//通过标签筛选出想要的结果
Route::get('home/fordel',"Home\DetailController@fordel");//删除！！！删除！！
Route::get('home/forback','Home\DetailController@forback');//历史收藏！！
Route::get('home/alldel','Home\DetailController@alldel');//批量删除
Route::get('home/search','Home\DetailController@search');

//主页热销书排行榜
Route::resource('/home/rank','Home\RankController');
//次主页列表
Route::resource('/home/list','Home\ListController');

Route::get('/home/list/jiage','Home\ListController@Jiage');

//次主页小导航条

Route::resource('/home/dao','Home\DaoController');

//次主页商品推广
//Route::resource('/home/list','Home\TuiguangController');

//次主页筛选
Route::resource('/home/lable','Home\LableController');

//Route::resource('/home/cha','Home\ChaController');

//新闻公告
Route::resource('/home/news','Home\NewsController');

//网站配置
Route::resource('/home/base','Home\ConfigController');

//网站维护
Route::get('/home/weihu','Home\NewsController@weihu');




//前台订单路由
Route::get('home/order/paycenter',"Home\OrderController@paycenter");//选择网上支付的方式
Route::resource('home/order',"Home\OrderController");//确认网上支付的方式
Route::get('home/shop/now/{id}',"Home\ShopController@now");//立即购买

